package com.lhkj.ct.meta.modules.psychology.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.lhkj.ct.base.enums.DeleteStatus;
import com.lhkj.ct.base.mybatis.IBaseEntity;
import com.lhkj.ct.base.validator.group.ValGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.sql.Time;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 测验报告
 * </p>
 *
 * @author jobob
 * @since 2023-10-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TblScaleReport对象", description="测验报告")
public class TblScaleReport implements IBaseEntity<String> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "报告id")
    private String id;

    @ApiModelProperty(value = "分配记录id")
    private String allotId;

    @ApiModelProperty(value = "量表id")
    private String scaleId;

    @NotBlank(message = "档案id不能为空", groups = {ValGroups.User.class})
    @ApiModelProperty(value = "用户id")
    private String patId;

    @ApiModelProperty(value = "姓名")
    private String patName;

    @ApiModelProperty(value = "性别", notes = "性别名称", example = "男")
    private String patSex;

    @ApiModelProperty(value = "年龄")
    private String patAge;

    @ApiModelProperty(value = "出生日期")
    private LocalDate patBirthday;

    @ApiModelProperty(value = "手机号码")
    private String patMobile;

    @ApiModelProperty(value = "开始时间")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "测评时间(提交时间)")
    private LocalDateTime submissionTime;

    @ApiModelProperty(value = "原始答卷")
    private String answerJson;

    @ApiModelProperty(value = "计时", hidden = true)
    private Time costTime;

    /**
     * 报告状态 -1.未完成 0.待审核 1.已审核 2.已发布
     */
    @ApiModelProperty(value = "报告状态 0.待审核 1.已审核 2.已发布")
    private Integer reportStatus;

    @ApiModelProperty(value = "是否预警")
    private boolean dangerous;

    @ApiModelProperty(value = "审核人")
    private String reviewBy;

    @ApiModelProperty(value = "审核时间")
    private LocalDateTime reviewTime;

    /**
     * 这里不添加@TableLogic，因为要做回收站
     */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "是否删除 0.未删除 1.已删除")
    private DeleteStatus delFlag;

    @TableField(exist = false)
    @ApiModelProperty(value = "量表名称")
    private String scaleName;

    @TableField(exist = false)
    @ApiModelProperty(value = "分配时间")
    private String allotTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "单位")
    private List<String> units;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否预警")
    private Boolean warn;

    @TableField(exist = false)
    @ApiModelProperty(value = "团体名称")
    private String unitName;
}
